#include<cstdio>
int main(){
	int m,n;
	scanf("%d %d",&n,&m);
	int t=0;
	int count=0;
	for(int i=0;i<=n;i++){
		if(i*2+(n-i)*4==m){
			count++;
			printf("%d J%d T%d\n",count,i,n-i);
			t=1;
			break;
		}
	}
	for(int o=0;o<=n;o++){
		if(o*2+(n-o)*6==m){
			count++;
			printf("%d J%d ZM%d\n",count,o,n-o);
			t=1;
			break;
		}
	}
	for(int oi=0;oi<=n;oi++){
		if(oi*2+(n-oi)*8==m){
			count++;
			printf("%d J%d ZZ%d\n",count,oi,n-oi);
			t=1;
			break;
		}
	}
	if(t==0){
		printf("No");
	}
} 
